import { ColumnType } from 'kysely';
import { auditSchema } from './audit';

export type User = {
  id: ColumnType<string, never>;
  name: string;
  username: string;
  email: string;
  emailVerified: number;
  image: string | null;
  role: string | null;
  banned: number;
  banReason: string | null;
} & auditSchema;

export type Session = {
  id: ColumnType<string, never>;
  expiresAt: ColumnType<Date, string, never>;
  ipAddress: string | null;
  userAgent: string | null;
  userId: string;
  token: string;
  impersonatedBy: string | null;
} & auditSchema;

export type Account = {
  id: ColumnType<string, never>;
  accountId: string;
  providerId: string;
  userId: string;
  accessToken: string | null;
  refreshToken: string | null;
  idToken: string | null;
  scope: string | null;
  expiresAt: ColumnType<Date, string, never>;
  accessTokenExpiresAt: ColumnType<Date, string>;
  refreshTokenExpiresAt: ColumnType<Date, string>;
  password: string | null;
} & auditSchema;

export type Verification = {
  id: ColumnType<string, never>;
  identifier: string;
  value: string;
  expiresAt: ColumnType<Date, string, never>;
} & auditSchema;
